package com.example.dahua.proxy.staticProxy;

/**
 * @author: dangwen
 * @createDate: 2021/7/3
 */
public class BuyHouseImplProxy implements BuyHouse {
    private BuyHouseImpl buyHouseImpl;
    public BuyHouseImplProxy(BuyHouseImpl buyHouse){
        this.buyHouseImpl = buyHouse;
    }
    @Override
    public void byHouse() {
        preByHouse();
        buyHouseImpl.byHouse();
        afterByHouse();
    }
    public void preByHouse(){
        System.out.println("请准备好钱!");
    }
    public void afterByHouse(){
        System.out.println("请带走房产证！");
    }
    public static void main(String[] args) {
        BuyHouseImplProxy proxy = new BuyHouseImplProxy(new BuyHouseImpl());
        proxy.byHouse();
    }
}
